package com.aaa.bookproject.service.impl;

import com.aaa.bookproject.dao.TLoginMapper;
import com.aaa.bookproject.entity.TLogin;
import com.aaa.bookproject.service.ITLoginService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Set;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author LvYongQi
 * @since 2021-05-09
 */
@Service
public class TLoginServiceImpl extends ServiceImpl<TLoginMapper, TLogin> implements ITLoginService {

    @Resource
    private TLoginMapper loginMapper;

    /**
     * 根据用户的Id获取对应的角色
     * @param staffid
     * @return
     */
    @Override
    public Set<String> getRoleidByStaffid(Integer staffid) {
        return loginMapper.getRoleidByStaffid(staffid);
    }

    /**
     * 根据用户Id查询所具有的资源文件
     * @param staffid
     * @return
     */
    @Override
    public Set<String> getMenusByStaffid(Integer staffid) {
        return loginMapper.getMenusByStaffid(staffid);
    }
}
